import com.fz.entity.Book;
import com.fz.mapper.BookMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

/**
 * Created by webrx on 2017-07-07.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:beans.xml")
public class Demo {
    @Autowired
    protected BookMapper bookdao;

    @Test
    public void aa(){
        List<Book> bks = bookdao.query();
        System.out.println(bks.size());
        for(Book b : bks){
            System.out.println(b.getName());
        }
    }
}
